# -*-coding:utf-8 -*-
import urllib.request
import json
import time
import xlwt
import os
import random

Authorization = 'opKBU1MVvM_q9JbztRYsbYiCfq50'
isipdl = True  # 是否开启代理
iphost = '127.0.0.1'
ipport = '1087'
timelt = 0.01 * random.randint(2, 9)  # 每个网页时间间隔

if not os.path.exists('result'):
    os.makedirs('result')


# 获取字符串长度，一个中文的长度为2
def len_byte(value):
    length = len(value)
    utf8_length = len(value.encode('utf-8'))
    length = (utf8_length - length) / 2 + length
    return int(length)


def get_proxys():
    User_Agent = 'Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10'
    header = {}
    header['User-Agent'] = User_Agent

    if isipdl:  # 是否开启代理
        proxy_support = urllib.request.ProxyHandler(
            {'http': f'{iphost}:{ipport}', 'https': f'{iphost}:{ipport}', 'sock5': f'{iphost}:{ipport}'})

        opener = urllib.request.build_opener(proxy_support)

        urllib.request.install_opener(opener)

    timemm = int(round(time.time() * 1000))
    urlstr = f"https://api1.lianlianlvyou.com/wx/city/list?timestamp={timemm}&i=wx6dc562d3a7a2b634&locationid=0"
    # urlstr = 'https://httpbin.org/ip' #这个验证IP代理是否有效
    nowipstr = urllib.request.urlopen('https://httpbin.org/ip').read()  # .decode('utf-8')
    print('检测到当前ip:', nowipstr)


    # htmlstr = urllib.request.urlopen(urlstr).read().decode("utf8")
    htmlstr = '''{"data":{"currentSiteList":[{"id":35,"city":"北京站","url":"https://cd-nt.lianlianlvyou.com/?i=wx6dc562d3a7a2b634","i":"wx6dc562d3a7a2b634"}],"hotSiteList":[{"id":1,"city":"成都站","url":"https://cd-nt.lianlianlvyou.com/?i=wxfab889240130c07a","i":"wxfab889240130c07a"},{"id":2,"city":"重庆站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf493c6f112741361","i":"wxf493c6f112741361"},{"id":3,"city":"武汉站","url":"https://cd-nt.lianlianlvyou.com/?i=wx95fd9e204c0880d5","i":"wx95fd9e204c0880d5"},{"id":4,"city":"西安站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc9a266f34d745542","i":"wxc9a266f34d745542"},{"id":35,"city":"北京站","url":"https://cd-nt.lianlianlvyou.com/?i=wx6dc562d3a7a2b634","i":"wx6dc562d3a7a2b634"},{"id":13,"city":"杭州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx616460aea548786f","i":"wx616460aea548786f"},{"id":15,"city":"长沙站","url":"https://cd-nt.lianlianlvyou.com/?i=wxcc5f2f7fff6002d8","i":"wxcc5f2f7fff6002d8"},{"id":16,"city":"南京站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb143f94165c9cf08","i":"wxb143f94165c9cf08"},{"id":38,"city":"南昌站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa3288f5a287ae97b","i":"wxa3288f5a287ae97b"},{"id":6,"city":"贵阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxcecb0dc24aedc15f","i":"wxcecb0dc24aedc15f"},{"id":10,"city":"昆明站","url":"https://cd-nt.lianlianlvyou.com/?i=wxeb77d3fb4a3a13cb","i":"wxeb77d3fb4a3a13cb"},{"id":60,"city":"上海站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3123417288065925","i":"wx3123417288065925"}],"allSiteList":[{"word":"A","siteList":[{"id":29,"city":"安宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf43287a78a6aa372","i":"wxf43287a78a6aa372"},{"id":22,"city":"安顺站","url":"https://cd-nt.lianlianlvyou.com/?i=wx67738ba598d3f7b2","i":"wx67738ba598d3f7b2"}]},{"word":"B","siteList":[{"id":257,"city":"巴南站（重庆7站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx6fb7e67bf7ba0df9","i":"wx6fb7e67bf7ba0df9"},{"id":194,"city":"宝安站（深圳3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxbe17928651f64b1c","i":"wxbe17928651f64b1c"},{"id":96,"city":"保定站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf963532127b8bbe4","i":"wxf963532127b8bbe4"},{"id":24,"city":"宝鸡站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc3e58044d2166b3c","i":"wxc3e58044d2166b3c"},{"id":155,"city":"宝山站（上海4站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxe6ab53c03c4b12b1","i":"wxe6ab53c03c4b12b1"},{"id":18,"city":"包头站","url":"https://cd-nt.lianlianlvyou.com/?i=wx49c84160c57f5413","i":"wx49c84160c57f5413"},{"id":35,"city":"北京站","url":"https://cd-nt.lianlianlvyou.com/?i=wx6dc562d3a7a2b634","i":"wx6dc562d3a7a2b634"},{"id":180,"city":"滨海站（天津2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx4940b218b10c6ce9","i":"wx4940b218b10c6ce9"}]},{"word":"C","siteList":[{"id":138,"city":"沧州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxeae56ee07c63532f","i":"wxeae56ee07c63532f"},{"id":69,"city":"长春站","url":"https://cd-nt.lianlianlvyou.com/?i=wx01cefd45c19e2975","i":"wx01cefd45c19e2975"},{"id":94,"city":"常德站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2f2f0bf768b6aca4","i":"wx2f2f0bf768b6aca4"},{"id":168,"city":"昌平站（北京2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx497e4a8d16b0b2d6","i":"wx497e4a8d16b0b2d6"},{"id":15,"city":"长沙站","url":"https://cd-nt.lianlianlvyou.com/?i=wxcc5f2f7fff6002d8","i":"wxcc5f2f7fff6002d8"},{"id":159,"city":"常熟站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb5f5b1c3a711bb2d","i":"wxb5f5b1c3a711bb2d"},{"id":78,"city":"常州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd7fd84aa47a6afbe","i":"wxd7fd84aa47a6afbe"},{"id":231,"city":"武进站（常州2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxfa34a833c3a36e94","i":"wxfa34a833c3a36e94"},{"id":1,"city":"成都站","url":"https://cd-nt.lianlianlvyou.com/?i=wxfab889240130c07a","i":"wxfab889240130c07a"},{"id":220,"city":"呈贡站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc5a58f41ce8f614e","i":"wxc5a58f41ce8f614e"},{"id":116,"city":"郴州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx8cfbc95191edcf4e","i":"wx8cfbc95191edcf4e"},{"id":2,"city":"重庆站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf493c6f112741361","i":"wxf493c6f112741361"},{"id":157,"city":"楚雄站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa9273d48f0375370","i":"wxa9273d48f0375370"},{"id":176,"city":"慈溪站","url":"https://cd-nt.lianlianlvyou.com/?i=wxe4f6babc45b40077","i":"wxe4f6babc45b40077"}]},{"word":"D","siteList":[{"id":71,"city":"大连站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3e3352df2e742fda","i":"wx3e3352df2e742fda"},{"id":198,"city":"丹东站","url":"https://cd-nt.lianlianlvyou.com/?i=wx399b65096e673f87","i":"wx399b65096e673f87"},{"id":221,"city":"丹阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx4f7de76f04965539","i":"wx4f7de76f04965539"},{"id":51,"city":"达州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx9571a1e523680465","i":"wx9571a1e523680465"},{"id":76,"city":"德阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7f9900c1fbb14f46","i":"wx7f9900c1fbb14f46"},{"id":87,"city":"东莞站","url":"https://cd-nt.lianlianlvyou.com/?i=wx22f04e423dca03fb","i":"wx22f04e423dca03fb"},{"id":177,"city":"斗门站（珠海2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx08c6d603ca48646f","i":"wx08c6d603ca48646f"},{"id":199,"city":"都江堰站","url":"https://cd-nt.lianlianlvyou.com/?i=wx0609650721c1eee7","i":"wx0609650721c1eee7"}]},{"word":"F","siteList":[{"id":91,"city":"涪陵站（重庆3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx87270743a7dca21a","i":"wx87270743a7dca21a"},{"id":86,"city":"佛山站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc439b16b184e8756","i":"wxc439b16b184e8756"},{"id":167,"city":"阜阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx766157d6c7ec370f","i":"wx766157d6c7ec370f"},{"id":83,"city":"福州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxe4f17f3ee77324ae","i":"wxe4f17f3ee77324ae"}]},{"word":"G","siteList":[{"id":142,"city":"赣州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx96e11b18f102608c","i":"wx96e11b18f102608c"},{"id":188,"city":"高邮站","url":"https://cd-nt.lianlianlvyou.com/?i=wx21b3593b8a93b171","i":"wx21b3593b8a93b171"},{"id":11,"city":"广安站","url":"https://cd-nt.lianlianlvyou.com/?i=wx676bcc32fdef3c0a","i":"wx676bcc32fdef3c0a"},{"id":153,"city":"广汉站","url":"https://cd-nt.lianlianlvyou.com/?i=wxbf9f6d43c7226147","i":"wxbf9f6d43c7226147"},{"id":228,"city":"广元站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb2ee7eb6c9536961","i":"wxb2ee7eb6c9536961"},{"id":66,"city":"广州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc9005ba38a317a4d","i":"wxc9005ba38a317a4d"},{"id":114,"city":"桂林站","url":"https://cd-nt.lianlianlvyou.com/?i=wxba3e420b04a2fb24","i":"wxba3e420b04a2fb24"},{"id":6,"city":"贵阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxcecb0dc24aedc15f","i":"wxcecb0dc24aedc15f"},{"id":150,"city":"固原站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3803667ae6542bd2","i":"wx3803667ae6542bd2"}]},{"word":"H","siteList":[{"id":56,"city":"海口站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc55255c435dbd92a","i":"wxc55255c435dbd92a"},{"id":234,"city":"海宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3014c0c349097ee2","i":"wx3014c0c349097ee2"},{"id":112,"city":"邯郸站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7ecf9226fb9439ef","i":"wx7ecf9226fb9439ef"},{"id":13,"city":"杭州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx616460aea548786f","i":"wx616460aea548786f"},{"id":209,"city":"汉阳站（武汉3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx963c601943972260","i":"wx963c601943972260"},{"id":26,"city":"汉中站","url":"https://cd-nt.lianlianlvyou.com/?i=wx437b0820d37a9036","i":"wx437b0820d37a9036"},{"id":70,"city":"哈尔滨站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7a2827240f37548b","i":"wx7a2827240f37548b"},{"id":32,"city":"合肥站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa18000139f0bb0b5","i":"wxa18000139f0bb0b5"},{"id":136,"city":"衡阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd619f07748d3259d","i":"wxd619f07748d3259d"},{"id":192,"city":"菏泽站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1d75931b84e03cc8","i":"wx1d75931b84e03cc8"},{"id":158,"city":"红河站","url":"https://cd-nt.lianlianlvyou.com/?i=wx149110fa914dbddb","i":"wx149110fa914dbddb"},{"id":204,"city":"花都站（广州4站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx7a4b2f35c4bc5d06","i":"wx7a4b2f35c4bc5d06"},{"id":139,"city":"淮安站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf7129f1b63112125","i":"wxf7129f1b63112125"},{"id":166,"city":"黄埔站（广州2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx853c424123012fed","i":"wx853c424123012fed"},{"id":75,"city":"呼和浩特站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7893ab024dd7b261","i":"wx7893ab024dd7b261"},{"id":222,"city":"惠阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx10d2127a47b7553a","i":"wx10d2127a47b7553a"},{"id":110,"city":"惠州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2a928089ef828999","i":"wx2a928089ef828999"},{"id":289,"city":"博罗站站（惠州4站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxca2eed6e826dc496","i":"wxca2eed6e826dc496"},{"id":103,"city":"葫芦岛站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2a18a434bb47ee5c","i":"wx2a18a434bb47ee5c"},{"id":28,"city":"鄠邑站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc6476dc838914f7e","i":"wxc6476dc838914f7e"},{"id":123,"city":"湖州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx12fa1ab5c877bbd9","i":"wx12fa1ab5c877bbd9"}]},{"word":"J","siteList":[{"id":173,"city":"嘉定站（上海8站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx5aa1b2b01bf5a507","i":"wx5aa1b2b01bf5a507"},{"id":181,"city":"江都站（扬州2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxc0fc0ba19458179c","i":"wxc0fc0ba19458179c"},{"id":109,"city":"江门站","url":"https://cd-nt.lianlianlvyou.com/?i=wx31692975981660f8","i":"wx31692975981660f8"},{"id":187,"city":"江宁站（南京3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx71dfbf3cff4965dd","i":"wx71dfbf3cff4965dd"},{"id":125,"city":"江阴站","url":"https://cd-nt.lianlianlvyou.com/?i=wx37ab87909e99b99e","i":"wx37ab87909e99b99e"},{"id":55,"city":"简阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx8fbd8b01e7669423","i":"wx8fbd8b01e7669423"},{"id":81,"city":"嘉兴站","url":"https://cd-nt.lianlianlvyou.com/?i=wx419e17e2d3bbd34d","i":"wx419e17e2d3bbd34d"},{"id":217,"city":"吉林站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb6849060a9d8337c","i":"wxb6849060a9d8337c"},{"id":42,"city":"济南站","url":"https://cd-nt.lianlianlvyou.com/?i=wxafe8beca5ccbe143","i":"wxafe8beca5ccbe143"},{"id":93,"city":"荆州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx74f190f8aae2e6db","i":"wx74f190f8aae2e6db"},{"id":117,"city":"金华站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5f33a16ac80b1325","i":"wx5f33a16ac80b1325"},{"id":178,"city":"济宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wxbc79f3df3b2a0683","i":"wxbc79f3df3b2a0683"},{"id":90,"city":"九江站","url":"https://cd-nt.lianlianlvyou.com/?i=wx871ead9518af72cf","i":"wx871ead9518af72cf"},{"id":206,"city":"句容站","url":"https://cd-nt.lianlianlvyou.com/?i=wx38c8bb7ab05f3032","i":"wx38c8bb7ab05f3032"}]},{"word":"K","siteList":[{"id":143,"city":"开封站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc7628264230dcb2c","i":"wxc7628264230dcb2c"},{"id":183,"city":"库尔勒站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5f3e44d872fffc24","i":"wx5f3e44d872fffc24"},{"id":10,"city":"昆明站","url":"https://cd-nt.lianlianlvyou.com/?i=wxeb77d3fb4a3a13cb","i":"wxeb77d3fb4a3a13cb"},{"id":124,"city":"昆山站","url":"https://cd-nt.lianlianlvyou.com/?i=wx606a3f55a2144ddc","i":"wx606a3f55a2144ddc"}]},{"word":"L","siteList":[{"id":144,"city":"廊坊站","url":"https://cd-nt.lianlianlvyou.com/?i=wx48ff9dd2b0aed96c","i":"wx48ff9dd2b0aed96c"},{"id":7,"city":"兰州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx38c0b5cdc0376092","i":"wx38c0b5cdc0376092"},{"id":106,"city":"乐山站","url":"https://cd-nt.lianlianlvyou.com/?i=wx85d82ae5b50b7f1b","i":"wx85d82ae5b50b7f1b"},{"id":47,"city":"梁平站","url":"https://cd-nt.lianlianlvyou.com/?i=wx9114b2c0cdeadbe6","i":"wx9114b2c0cdeadbe6"},{"id":100,"city":"连云港站","url":"https://cd-nt.lianlianlvyou.com/?i=wx8bfeac912179f71a","i":"wx8bfeac912179f71a"},{"id":119,"city":"丽江站","url":"https://cd-nt.lianlianlvyou.com/?i=wxfaf649bb8849d750","i":"wxfaf649bb8849d750"},{"id":43,"city":"临汾站","url":"https://cd-nt.lianlianlvyou.com/?i=wxdbfa18a8cd3c18ed","i":"wxdbfa18a8cd3c18ed"},{"id":132,"city":"临沂站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5d26089b8a633411","i":"wx5d26089b8a633411"},{"id":154,"city":"六盘水站","url":"https://cd-nt.lianlianlvyou.com/?i=wx80a097a11666600a","i":"wx80a097a11666600a"},{"id":131,"city":"柳州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb916fed8984761a2","i":"wxb916fed8984761a2"},{"id":219,"city":"溧阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc67b23b306689f0a","i":"wxc67b23b306689f0a"},{"id":165,"city":"龙岗站（深圳2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxa16574fb9c118a0d","i":"wxa16574fb9c118a0d"},{"id":30,"city":"龙泉驿站","url":"https://cd-nt.lianlianlvyou.com/?i=wx6c8eee08488c98c0","i":"wx6c8eee08488c98c0"},{"id":12,"city":"陇西站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa80f204a48e0ccf2","i":"wxa80f204a48e0ccf2"},{"id":53,"city":"娄底站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7ef6004518543541","i":"wx7ef6004518543541"},{"id":179,"city":"六安站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7b5252061923ba81","i":"wx7b5252061923ba81"},{"id":133,"city":"洛阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5ff9eedb7faa6bbb","i":"wx5ff9eedb7faa6bbb"},{"id":130,"city":"泸州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx77243c5ec8630aaf","i":"wx77243c5ec8630aaf"}]},{"word":"M","siteList":[{"id":208,"city":"马鞍山站","url":"https://cd-nt.lianlianlvyou.com/?i=wx780c926c8a5da237","i":"wx780c926c8a5da237"},{"id":134,"city":"茂名站","url":"https://cd-nt.lianlianlvyou.com/?i=wx803d961159373b29","i":"wx803d961159373b29"},{"id":19,"city":"眉山站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3fd51c00ab2de701","i":"wx3fd51c00ab2de701"},{"id":9,"city":"绵阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1ef55432a6484881","i":"wx1ef55432a6484881"},{"id":171,"city":"闵行站（上海6站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxd16410560a3f0469","i":"wxd16410560a3f0469"}]},{"word":"N","siteList":[{"id":38,"city":"南昌站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa3288f5a287ae97b","i":"wxa3288f5a287ae97b"},{"id":107,"city":"南充站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa47c3f366fce0783","i":"wxa47c3f366fce0783"},{"id":16,"city":"南京站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb143f94165c9cf08","i":"wxb143f94165c9cf08"},{"id":65,"city":"南宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wxe34c0f5b8bfdf233","i":"wxe34c0f5b8bfdf233"},{"id":79,"city":"南通站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd9a9dbd3aab10dfa","i":"wxd9a9dbd3aab10dfa"},{"id":135,"city":"南阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7df451eb487b72a3","i":"wx7df451eb487b72a3"},{"id":149,"city":"内江站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2297fb077ff49698","i":"wx2297fb077ff49698"},{"id":25,"city":"宁波站","url":"https://cd-nt.lianlianlvyou.com/?i=wxcaddb4b8bb7d7282","i":"wxcaddb4b8bb7d7282"}]},{"word":"P","siteList":[{"id":200,"city":"番禺站（广州3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx158695455bfaee06","i":"wx158695455bfaee06"},{"id":49,"city":"郫都站","url":"https://cd-nt.lianlianlvyou.com/?i=wxbb7c552a0380f4db","i":"wxbb7c552a0380f4db"},{"id":57,"city":"平顶山站","url":"https://cd-nt.lianlianlvyou.com/?i=wxcc1e1385b7a75622","i":"wxcc1e1385b7a75622"},{"id":170,"city":"浦东站（上海5站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxddd157ee1a67fb4d","i":"wxddd157ee1a67fb4d"},{"id":118,"city":"普洱站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa8b7be788933eb2c","i":"wxa8b7be788933eb2c"},{"id":202,"city":"浦口站（南京2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx67082b842a7aa0d1","i":"wx67082b842a7aa0d1"},{"id":147,"city":"莆田站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf0b5e00231acf644","i":"wxf0b5e00231acf644"},{"id":127,"city":"濮阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxe64eca0579559086","i":"wxe64eca0579559086"}]},{"word":"Q","siteList":[{"id":215,"city":"迁安站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5a740f63ab7852a2","i":"wx5a740f63ab7852a2"},{"id":191,"city":"青白江站（成都10站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx684b1482c12003ba","i":"wx684b1482c12003ba"},{"id":14,"city":"青岛站","url":"https://cd-nt.lianlianlvyou.com/?i=wxeb67a1f0d495377d","i":"wxeb67a1f0d495377d"},{"id":232,"city":"黄岛站（青岛2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxf44fd16d2c35dcec","i":"wxf44fd16d2c35dcec"},{"id":248,"city":"城阳站（青岛3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx45fa8f05fd386a1a","i":"wx45fa8f05fd386a1a"},{"id":225,"city":"清远站","url":"https://cd-nt.lianlianlvyou.com/?i=wx38321a1154876d44","i":"wx38321a1154876d44"},{"id":196,"city":"秦皇岛站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2f540fa4698c8c6c","i":"wx2f540fa4698c8c6c"},{"id":44,"city":"齐齐哈尔","url":"https://cd-nt.lianlianlvyou.com/?i=wx6ff1cfea2f2b4fa6","i":"wx6ff1cfea2f2b4fa6"},{"id":211,"city":"栖霞站（南京4站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxe48b00bc19296a60","i":"wxe48b00bc19296a60"},{"id":31,"city":"泉州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx862a01f54ec19046","i":"wx862a01f54ec19046"},{"id":59,"city":"曲靖站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb344fcb36a94ddb2","i":"wxb344fcb36a94ddb2"}]},{"word":"R","siteList":[{"id":85,"city":"仁寿站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb70b261de7f41576","i":"wxb70b261de7f41576"}]},{"word":"S","siteList":[{"id":97,"city":"三门峡站","url":"https://cd-nt.lianlianlvyou.com/?i=wx691708cb184f85f5","i":"wx691708cb184f85f5"},{"id":21,"city":"三明站","url":"https://cd-nt.lianlianlvyou.com/?i=wx9b3048c1b589eaed","i":"wx9b3048c1b589eaed"},{"id":58,"city":"三亚站","url":"https://cd-nt.lianlianlvyou.com/?i=wx503e5d449e83c3c0","i":"wx503e5d449e83c3c0"},{"id":60,"city":"上海站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3123417288065925","i":"wx3123417288065925"},{"id":17,"city":"商丘站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5406eeafecd1cb17","i":"wx5406eeafecd1cb17"},{"id":145,"city":"上饶站","url":"https://cd-nt.lianlianlvyou.com/?i=wx90e4a1647ed69be8","i":"wx90e4a1647ed69be8"},{"id":129,"city":"汕头站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2e26aa3625c4a768","i":"wx2e26aa3625c4a768"},{"id":82,"city":"绍兴站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf2b2a6568c5c3e9b","i":"wxf2b2a6568c5c3e9b"},{"id":68,"city":"沈阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx4f825ed10f172ac0","i":"wx4f825ed10f172ac0"},{"id":67,"city":"深圳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb2165886eede314a","i":"wxb2165886eede314a"},{"id":40,"city":"石家庄站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7b35765e74e35dcc","i":"wx7b35765e74e35dcc"},{"id":52,"city":"双流站（成都3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx6ae3945c3bd14712","i":"wx6ae3945c3bd14712"},{"id":172,"city":"顺德站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb0871b26b2041de3","i":"wxb0871b26b2041de3"},{"id":102,"city":"顺义站（北京4站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx6f4d3913768a3681","i":"wx6f4d3913768a3681"},{"id":169,"city":"松江站（上海3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx9505fa50ecaa3fb0","i":"wx9505fa50ecaa3fb0"},{"id":61,"city":"遂宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd38fcc92b3dfd2e3","i":"wxd38fcc92b3dfd2e3"},{"id":218,"city":"宿迁站","url":"https://cd-nt.lianlianlvyou.com/?i=wx78d44ad16fc01c64","i":"wx78d44ad16fc01c64"},{"id":41,"city":"苏州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx75e021023a75a274","i":"wx75e021023a75a274"}]},{"word":"T","siteList":[{"id":212,"city":"泰安站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb01787367ee50a86","i":"wxb01787367ee50a86"},{"id":224,"city":"太仓站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7214096dab337554","i":"wx7214096dab337554"},{"id":63,"city":"太原站","url":"https://cd-nt.lianlianlvyou.com/?i=wx843539c03da5541d","i":"wx843539c03da5541d"},{"id":120,"city":"泰州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx7e5df39e25da9817","i":"wx7e5df39e25da9817"},{"id":121,"city":"台州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd4b0fe0c366e207c","i":"wxd4b0fe0c366e207c"},{"id":72,"city":"唐山站","url":"https://cd-nt.lianlianlvyou.com/?i=wxeb5470355b37c57d","i":"wxeb5470355b37c57d"},{"id":33,"city":"天津站","url":"https://cd-nt.lianlianlvyou.com/?i=wxa6a6fd2e182ed827","i":"wxa6a6fd2e182ed827"},{"id":37,"city":"铜川站","url":"https://cd-nt.lianlianlvyou.com/?i=wx57124869ff74ce86","i":"wx57124869ff74ce86"},{"id":185,"city":"铜陵站","url":"https://cd-nt.lianlianlvyou.com/?i=wx098893f4f91a74b4","i":"wx098893f4f91a74b4"},{"id":182,"city":"桐乡站","url":"https://cd-nt.lianlianlvyou.com/?i=wx6ecd9d37ca8c74a4","i":"wx6ecd9d37ca8c74a4"},{"id":111,"city":"通州站（北京3站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx714f5df82d00617c","i":"wx714f5df82d00617c"}]},{"word":"W","siteList":[{"id":46,"city":"万州站（重庆2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx7f5352f86cc1518b","i":"wx7f5352f86cc1518b"},{"id":140,"city":"潍坊站","url":"https://cd-nt.lianlianlvyou.com/?i=wx39f7f7b0ebd9a3a5","i":"wx39f7f7b0ebd9a3a5"},{"id":108,"city":"威海站","url":"https://cd-nt.lianlianlvyou.com/?i=wx764d2d4d4e973770","i":"wx764d2d4d4e973770"},{"id":36,"city":"渭南站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf2ef3c4902c82910","i":"wxf2ef3c4902c82910"},{"id":54,"city":"温江站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf397ceae97043605","i":"wxf397ceae97043605"},{"id":105,"city":"温州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1efdfe9db8d22de6","i":"wx1efdfe9db8d22de6"},{"id":64,"city":"乌鲁木齐站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd90d98312ee6eb4f","i":"wxd90d98312ee6eb4f"},{"id":216,"city":"乌海站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd4bbe8001df5982e","i":"wxd4bbe8001df5982e"},{"id":3,"city":"武汉站","url":"https://cd-nt.lianlianlvyou.com/?i=wx95fd9e204c0880d5","i":"wx95fd9e204c0880d5"},{"id":207,"city":"汉口站（武汉2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx24a846b97458c599","i":"wx24a846b97458c599"},{"id":34,"city":"芜湖站","url":"https://cd-nt.lianlianlvyou.com/?i=wxe14f9248b4e29cab","i":"wxe14f9248b4e29cab"},{"id":174,"city":"吴江站（苏州2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx1140dd05c018b899","i":"wx1140dd05c018b899"},{"id":39,"city":"无锡站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb3f372169a707335","i":"wxb3f372169a707335"},{"id":223,"city":"惠山站（无锡2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx98131a00173af122","i":"wx98131a00173af122"}]},{"word":"X","siteList":[{"id":84,"city":"厦门站","url":"https://cd-nt.lianlianlvyou.com/?i=wx64763e614f1fd30f","i":"wx64763e614f1fd30f"},{"id":4,"city":"西安站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc9a266f34d745542","i":"wxc9a266f34d745542"},{"id":190,"city":"湘潭站","url":"https://cd-nt.lianlianlvyou.com/?i=wx56175f0bd8b85704","i":"wx56175f0bd8b85704"},{"id":99,"city":"襄阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wxab8094ee2ef00417","i":"wxab8094ee2ef00417"},{"id":244,"city":"咸宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wx9e9760d1749d0eb8","i":"wx9e9760d1749d0eb8"},{"id":23,"city":"咸阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx06d77ba1a9a21006","i":"wx06d77ba1a9a21006"},{"id":193,"city":"萧山站（杭州2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx139f05400527dabe","i":"wx139f05400527dabe"},{"id":45,"city":"西昌站","url":"https://cd-nt.lianlianlvyou.com/?i=wx73dfd7d3665612b9","i":"wx73dfd7d3665612b9"},{"id":50,"city":"新都站（成都6站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx294b24292397ff36","i":"wx294b24292397ff36"},{"id":27,"city":"兴安盟站","url":"https://cd-nt.lianlianlvyou.com/?i=wx83d7cf4a5d8b0c6a","i":"wx83d7cf4a5d8b0c6a"},{"id":214,"city":"邢台站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1e220d318b18a114","i":"wx1e220d318b18a114"},{"id":77,"city":"西宁站","url":"https://cd-nt.lianlianlvyou.com/?i=wx524a675625953097","i":"wx524a675625953097"},{"id":245,"city":"新建站（南昌2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx592608b8516a87d6","i":"wx592608b8516a87d6"},{"id":141,"city":"新乡站","url":"https://cd-nt.lianlianlvyou.com/?i=wx662447a0c8ec6ff1","i":"wx662447a0c8ec6ff1"},{"id":146,"city":"信阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx889e34ea77c50c0b","i":"wx889e34ea77c50c0b"},{"id":74,"city":"徐州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx80fdf687693ee026","i":"wx80fdf687693ee026"}]},{"word":"Y","siteList":[{"id":62,"city":"雅安站","url":"https://cd-nt.lianlianlvyou.com/?i=wxce7ea826a0083118","i":"wxce7ea826a0083118"},{"id":235,"city":"延安站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc3b105f1c624a2eb","i":"wxc3b105f1c624a2eb"},{"id":148,"city":"盐城站","url":"https://cd-nt.lianlianlvyou.com/?i=wxce29ed6cd1bfc855","i":"wxce29ed6cd1bfc855"},{"id":213,"city":"阳江站","url":"https://cd-nt.lianlianlvyou.com/?i=wxafbfc19798554191","i":"wxafbfc19798554191"},{"id":162,"city":"杨浦站（上海2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxe9cb18ee1d916ed9","i":"wxe9cb18ee1d916ed9"},{"id":73,"city":"烟台站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3988a7ae6f7a00a2","i":"wx3988a7ae6f7a00a2"},{"id":104,"city":"扬州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2e94ba10a1056605","i":"wx2e94ba10a1056605"},{"id":186,"city":"燕郊站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1b7af21b5ad369c2","i":"wx1b7af21b5ad369c2"},{"id":88,"city":"宜宾站","url":"https://cd-nt.lianlianlvyou.com/?i=wx9d05e31c0f9df922","i":"wx9d05e31c0f9df922"},{"id":98,"city":"宜昌站","url":"https://cd-nt.lianlianlvyou.com/?i=wxfbe346ba702493f2","i":"wxfbe346ba702493f2"},{"id":5,"city":"银川站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf1a2363432bf326a","i":"wxf1a2363432bf326a"},{"id":241,"city":"营口站","url":"https://cd-nt.lianlianlvyou.com/?i=wx58f71c3af986cee9","i":"wx58f71c3af986cee9"},{"id":128,"city":"义乌站","url":"https://cd-nt.lianlianlvyou.com/?i=wx13128b732e0c38ce","i":"wx13128b732e0c38ce"},{"id":126,"city":"宜兴站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2c876ab06208d7a8","i":"wx2c876ab06208d7a8"},{"id":152,"city":"仪征站","url":"https://cd-nt.lianlianlvyou.com/?i=wxe2c2708ccce516c1","i":"wxe2c2708ccce516c1"},{"id":122,"city":"岳阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5e544c1956624070","i":"wx5e544c1956624070"},{"id":195,"city":"榆林站","url":"https://cd-nt.lianlianlvyou.com/?i=wx9524eea63677bde1","i":"wx9524eea63677bde1"},{"id":254,"city":"玉林站","url":"https://cd-nt.lianlianlvyou.com/?i=wx60cee6fd15a1677d","i":"wx60cee6fd15a1677d"},{"id":210,"city":"运城站","url":"https://cd-nt.lianlianlvyou.com/?i=wx43d799d37fa60b14","i":"wx43d799d37fa60b14"},{"id":95,"city":"玉溪站","url":"https://cd-nt.lianlianlvyou.com/?i=wxf4828cb6cde65e0e","i":"wxf4828cb6cde65e0e"}]},{"word":"Z","siteList":[{"id":203,"city":"增城站（广州5站）","url":"https://cd-nt.lianlianlvyou.com/?i=wxa35be197ce4fd3bf","i":"wxa35be197ce4fd3bf"},{"id":201,"city":"张家港站","url":"https://cd-nt.lianlianlvyou.com/?i=wxbf4982d92bcc662c","i":"wxbf4982d92bcc662c"},{"id":164,"city":"张家口站","url":"https://cd-nt.lianlianlvyou.com/?i=wx3a8f922ac2fa090a","i":"wx3a8f922ac2fa090a"},{"id":189,"city":"漳州站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1edb0740014bb5e6","i":"wx1edb0740014bb5e6"},{"id":163,"city":"湛江站","url":"https://cd-nt.lianlianlvyou.com/?i=wxc51295f7ba29fea9","i":"wxc51295f7ba29fea9"},{"id":226,"city":"肇庆站","url":"https://cd-nt.lianlianlvyou.com/?i=wx2e830a983e607d46","i":"wx2e830a983e607d46"},{"id":151,"city":"昭通站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd06b231577ca400a","i":"wxd06b231577ca400a"},{"id":8,"city":"郑州站","url":"https://cd-nt.lianlianlvyou.com/?i=wxd6377d530df69a16","i":"wxd6377d530df69a16"},{"id":80,"city":"镇江站","url":"https://cd-nt.lianlianlvyou.com/?i=wx5bdaf68ff3050109","i":"wx5bdaf68ff3050109"},{"id":115,"city":"中山站","url":"https://cd-nt.lianlianlvyou.com/?i=wx139ee3bc21ef3f3d","i":"wx139ee3bc21ef3f3d"},{"id":242,"city":"小榄站（中山2站）","url":"https://cd-nt.lianlianlvyou.com/?i=wx33ade3f9bf513905","i":"wx33ade3f9bf513905"},{"id":101,"city":"舟山站","url":"https://cd-nt.lianlianlvyou.com/?i=wxbe31f27c3904ed4c","i":"wxbe31f27c3904ed4c"},{"id":113,"city":"珠海站","url":"https://cd-nt.lianlianlvyou.com/?i=wx63c7ac264fb0616b","i":"wx63c7ac264fb0616b"},{"id":156,"city":"诸暨站","url":"https://cd-nt.lianlianlvyou.com/?i=wx4a01a5a0770adc48","i":"wx4a01a5a0770adc48"},{"id":137,"city":"株洲站","url":"https://cd-nt.lianlianlvyou.com/?i=wxfa2fefa5b0dd8a9d","i":"wxfa2fefa5b0dd8a9d"},{"id":48,"city":"淄博站","url":"https://cd-nt.lianlianlvyou.com/?i=wxb948f1880f5d3166","i":"wxb948f1880f5d3166"},{"id":89,"city":"自贡站","url":"https://cd-nt.lianlianlvyou.com/?i=wx1c181d85466b841f","i":"wx1c181d85466b841f"},{"id":20,"city":"资阳站","url":"https://cd-nt.lianlianlvyou.com/?i=wx0bbf29e52f738c73","i":"wx0bbf29e52f738c73"},{"id":92,"city":"遵义站","url":"https://cd-nt.lianlianlvyou.com/?i=wx73d62902da1fdd9e","i":"wx73d62902da1fdd9e"}]}]}}'''

    # f = open('result/citysdata.json', 'w')
    # f.write(htmlstr)  # 保存结果

    dicdata = json.loads(htmlstr)
    diclist = dicdata['data']  # 城市列表
    allSiteList = diclist['allSiteList']  # 城市列表

    for citysdata in allSiteList:
        siteList = citysdata['siteList']
        for city in siteList:

            cityi = city['i']
            cityid = city['id']
            hasdata = True
            pageIndex = 1
            row_num = 0
            while hasdata:
                print('分页-->: 新的一页🚛')
                timelt = 0.01 * random.randint(2, 9)
                time.sleep(timelt)
                timemm = int(round(time.time() * 1000))
                urlstr1 = f'https://api.lianlianlvyou.com/v1/wx/list?timestamp={timemm}&i={cityi}&iplocated=0&c=&t=1&pageSize=10&pageIndex={pageIndex}&locationid={cityid}'
                # print('请求网址-->', urlstr1)
                htmlstr1 = urllib.request.urlopen(urlstr1).read().decode("utf8")
                datamain = json.loads(htmlstr1)
                datas = datamain['data']['list']['data']  # 本分页所有商品
                currentSite = datamain['data']['currentSite']['city']  # 本分页所属城市
                shopTitle = datamain['data']['agentUser']['shopTitle']  # 本分页所属活动
                allrowCount = datamain['data']['list']['rowCount']  # 共多少条

                if pageIndex == 1:
                    wb = xlwt.Workbook(encoding='utf-8')
                    ws = wb.add_sheet(currentSite)
                    # Sheet header, first row

                    font_style = xlwt.XFStyle()
                    font_style.font.bold = True

                    columns = ['来源', '标题', '链接', '图片地址 ', '抢购价|门店价', '返现', '销量',
                               '规格|抢购价|门店价（多规格用~~分割）', '门店|地址（多门店用~~分割）', ]
                    for col_num in range(len(columns)):
                        ws.col(col_num).width = 1024 * 5
                        ws.write(row_num, col_num, columns[col_num], font_style)
                font_style = xlwt.XFStyle()
                font_style.font.bold = False
                hasdata = len(datas) > 0
                if hasdata:
                    for da in datas:
                        print(f'抓取-->: {currentSite}/共{len(allSiteList)}城市, 第{row_num + 1}/共{allrowCount}')
                        time.sleep(timelt)
                        timemm = int(round(time.time() * 1000))
                        dataid = da['id']

                        urlstr2 = f"https://api1.lianlianlvyou.com/v1/wx/product2?timestamp={timemm}&Authorization={Authorization}&c=&i={cityi}&id={dataid}"
                        # print('请求网址-->', urlstr2)
                        htmlstr2 = urllib.request.urlopen(urlstr2).read().decode("utf8")
                        datamain2 = json.loads(htmlstr2)
                        storename = datamain2['data']['bizProduct']['name']  # 店名
                        print('店名-->:', storename)

                        items = ""
                        try:
                            for item in datamain2['data']['bizProduct']['items']:
                                if len(items) > 0:
                                    items = items + "~~"
                                items = item['subTitle'] + "|" + item['salePriceStr'] + '|' + item['originPriceStr']
                        except Exception as r:
                            shops = "items"

                        shops = ""
                        try:
                            shops = ""
                            for shop in datamain2['data']['bizProduct']['shops']:
                                if len(shops) > 0:
                                    shops = shops + "~~"
                                shops = shop['name'] + "|" + shop['address']
                        except Exception as r:
                            shops = "null"

                        try:
                            da: dict = da

                            # ['来源', '标题', '链接', '图片地址', '抢购价|门店价', '返现', '销量','规格|抢购价|门店价（多规格用~~分割）', '门店|地址（多门店用~~分割）', ]
                            rows = [shopTitle, da['title'], str(datamain2.get('data').get('productHtmlUrl')),
                                    str(da['faceImg']),
                                    str(da['salePriceStr']) + "|" + str(da.get('originPriceStr')), '',
                                    str(da['saleAmount']),
                                    items, shops, ]

                            row_num += 1
                            for col_num in range(len(rows)):
                                ws.write(row_num, col_num, rows[col_num], font_style)

                            print('保存-->: ✅保存成功')
                        except Exception as r:
                            print('保存-->: ⛔️保存失败', r)

                    wb.save(f'result/{currentSite}.xls')

                pageIndex = pageIndex + 1


if __name__ == '__main__':
    get_proxys()
